﻿using _07_04_DBHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _08_01_Sql_Exec执行语句
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string sql = $"exec procInsertMember '{this.textBox1.Text}','{this.textBox2.Text}','{this.textBox3.Text}','{this.textBox4.Text}'";
            DBHelper.PrepareCmd(sql);
            int count = DBHelper.ExecNonQuery();
            if (count > 0)
            {
                MessageBox.Show("插入成功");
            }
            else
            {
                MessageBox.Show("插入失败");
            }
        }
    }
}
